import service from '@/utils/request'
export function useGetTrackPosApi(data: any) {
  return service.get('/gps/trackPos', {
    params: data
  })
}

// export function useGetAllCmdApi(data) {
//   return service.get('/gps/command_type/cmdForDevice', {
//     params: data
//   })
// }

export function useSendCommand(data) {
  return service.post('/gps/command/sendCmd', data)
}

export function getLastPosition(data) {
  return service.get('/gps/lastPosition', {
    params: data
  })
}

export function getimeiInfoApi(imei) {
  return service.get('/gps/device/listPage?imei=' + imei)
}


export function useGetEnclosureDataApi(id: string) {
  return service.get('/geofence/info/' + id)
}

export function useGetDeviceMileageDrivenApi(data: { imei: string; startTime: string; endTime: string }) {
  return service.get('gps/device/distance/list', {
    params: data
  })
}
